package com.zch.starter.metrics.prometheus.springboot.starter.metrics.gauge;

import com.zch.starter.metrics.prometheus.springboot.starter.metrics.AbstractMetricsInfo;

/**
 * 直接创建一个spring的对象继承AbstractRegisterGauge 就可以了RegisterGaugeServer 会自动把该gauge 注册到register 上
 */
@Deprecated
public class GaugeMetricsInfo extends AbstractMetricsInfo {
    private AbstractRegisterGauge gauge ;
    private GaugeMetricsInfo(){};
    public static GaugeMetricsInfo _gauge(AbstractRegisterGauge gauge)  {
        GaugeMetricsInfo metricsInfo = new GaugeMetricsInfo();
        metricsInfo.setMetricsName(gauge.getMetricName());
        metricsInfo.setType(GAUGE);
        metricsInfo.setGauge(gauge);
        return metricsInfo;
    }

    public AbstractRegisterGauge getGauge() {
        return gauge;
    }

    public void setGauge(AbstractRegisterGauge gauge) {
        this.gauge = gauge;
    }
}
